package unit4.part12.package_post;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        float weight = sc.nextFloat();
        float length = sc.nextFloat();
        float width = sc.nextFloat();
        float height = sc.nextFloat();
        sc.close();

        boolean flag = checkPost(weight, length, width, height);
        if (!flag) {
            System.out.println("该包裹不符邮寄规定！");
            return;
        }
        double money = getMoney(weight);
        System.out.println(money);
    }

    public static boolean checkPost(float weight, float length, float width, float height) {
        return !(weight > 200) && !(length > 200) && !(width > 200) && !(height > 200);
    }

    public static double getMoney(double weight) {
        double money;
        if (weight <= 100) {
            money = 2 + weight * 0.8;
        } else if (weight <= 150) {
            money = 2 + weight * 0.75;
        } else {
            money = 2 + weight * 0.7;
        }
        return money;
    }
}